#include "myStdio.h"
#include <stdio.h>

int main()
{
    FILE_ *fp = fopen_("./log.txt","w");
    if(fp == NULL)
    {
        return 1;
    }

    //const char *msg = "hello world\n";
    int cnt = 10;
    const char *msg = "hello world";
    //const char *msg = "hello world\n";

    while(1)
    {
        fwirte_(msg, strlen(msg), fp);
        sleep(1);
       printf("count:%d\n",cnt);
       if(cnt == 5)
           fflush_(fp);
       cnt--;
       if(cnt == 0)
            break;
    }
    //fwirte_( msg, strlen(msg), fp);
    fclose_(fp);
    return 0;
}
